<?php
if($_GET['tpl_id']){
include('includes/_config.php');
include('includes/_functions.php');
$func = new func;
$tpl_id=$_GET['tpl_id'];
$qr=$DB->query("SELECT * FROM {$conf['prefix']}tpl WHERE tpl_id={$tpl_id}");
$folder=$DB->fetch_row($qr);
$sql=$DB->query("SELECT skin_value FROM {$conf['prefix']}skin WHERE skin_tpl='{$tpl_id}' AND skin_name='styles'");
$ro=$DB->fetch_row($sql);
$css=$func->unhtmlchars(stripslashes($ro['skin_value']));
$css = str_replace('{TPL_LINK}', "templates/".$folder['tpl_foldername'], $css);
header("Accept-Ranges: bytes"); 
header("Content-Type: text/css");
echo $css;

}


?>